package com.road.service.imp;

import java.sql.SQLException;
import java.util.List;

import com.road.dao.ICommentDao;
import com.road.dao.INewsDao;
import com.road.dao.imp.CommentDaoImp;
import com.road.dao.imp.NewsDaoImp;
import com.road.model.Comment;
import com.road.service.ICommentService;

public class CommentServiceImp implements ICommentService {
    ICommentDao idao=new CommentDaoImp();
    INewsDao dao=new NewsDaoImp();
	@Override
	public int saveComment(String userPhone, String newsId, String content) throws SQLException {
		// TODO Auto-generated method stub
		  //更新评论次数
		  dao.updateCommentTimesBy(newsId, 1);
		return idao.saveComment(userPhone, newsId, content);
	}

	@Override
	public List<Comment> getCommentListByNewsId(String news_id) throws SQLException {
		// TODO Auto-generated method stub
		return idao.getCommentListByNewsId(news_id);
	}

}
